<template>
  <view style="padding: 20px">
    <view
        style="padding-left: 30px; padding-top: 5px; font-weight: bold; font-size: 30px;text-shadow: 1px 1px 2px green">
      GJ校聚后台管理
    </view>
<!--    <el-image style="width: 50px; border-radius: 50px"
              src="http://img.greenxiazai.com/d/file/2022/0719/bjtmzbv032e.png"></el-image> -->
  </view>
  <el-container class="layout-container-demo" style="height: 888px">
    <el-aside width="240px">
      <el-scrollbar>
        <!--        <el-menu :default-openeds="['1', '3']">-->
        <el-menu unique-opened="true">

          <el-sub-menu index="1">
            <template #title>
              <el-icon>
                <message/>
              </el-icon>
              审核管理
            </template>
            <el-menu-item-group>
              <template #title>店铺</template>
              <el-menu-item v-if="userRole === 'qualification'" index="1-1"
                            @click="checkShop()">店铺资质审核
              </el-menu-item>
              <el-menu-item v-if="userRole === 'compliance'" index="1-1-1"
                            @click="checkComplianceShop()">店铺合规审核
              </el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group title="广告">
              <el-menu-item v-if="userRole === 'compliance'" index="1-2"
                            @click="checkAdvertisement">广告合法审核
              </el-menu-item>
              <el-menu-item v-if="userRole === 'admin'" index="1-2-1" @click="checkAdminAdvertisement">管理员审核
              </el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group title="投诉">
              <el-menu-item v-if="userRole === 'compliance'" index="1-3"
                            @click="checkComplaint">投诉合规审核
              </el-menu-item>
              <el-menu-item v-if="userRole === 'finance'" index="1-3-1" @click="checkFinance">
                财务投诉审核
              </el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group title="优惠券">
              <el-menu-item v-if="userRole === 'operation_specialist'" index="1-4-0"
                            @click="checkAddCoupon">优惠券添加
              </el-menu-item>
              <el-menu-item v-if="userRole === 'operation_manager'" index="1-4"
                            @click="checkCoupon">优惠券审核
              </el-menu-item>
              <el-menu-item v-if="userRole === 'business'" index="1-4-1"
                            @click="checkShopCoupon">商家二次审核
              </el-menu-item>
            </el-menu-item-group>

          </el-sub-menu>
          <el-sub-menu v-if="userRole === 'admin'" index="2">
            <template #title>
              <el-icon>
                <icon-menu/>
              </el-icon>
              系统管理
            </template>
            <el-menu-item-group>
              <template #title>用户</template>
              <el-menu-item index="2-1" @click="openOne">用户管理</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <template #title>店铺</template>
              <el-menu-item index="2-2" @click="openTwo">店铺管理</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <template #title>聊天</template>
              <el-menu-item index="2-3" @click="openThree">聊天管理</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <template #title>店铺评论</template>
              <el-menu-item index="2-4" @click="openFour">店铺评论管理</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <template #title>投诉</template>
              <el-menu-item index="2-5" @click="openFive">投诉管理</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <template #title>优惠券</template>
              <el-menu-item index="2-6" @click="openSix">优惠券管理</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <template #title>菜品</template>
              <el-menu-item index="2-7" @click="openSeven">菜品管理</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <template #title>消息</template>
              <el-menu-item index="2-8" @click="openEight">消息管理</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <template #title>操作</template>
              <el-menu-item index="2-9" @click="openNine">操作管理</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <template #title>帖子分类</template>
              <el-menu-item index="2-10" @click="openTen">帖子管理</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <template #title>帖子评论</template>
              <el-menu-item index="2-11" @click="openEleven">帖子分类管理</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <template #title>帖子</template>
              <el-menu-item index="2-12" @click="openTwelve">帖子评论管理</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <template #title>轮播图</template>
              <el-menu-item index="2-13" @click="openThirteen">轮播图管理</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <template #title>标签</template>
              <el-menu-item index="2-14" @click="openFourteen">标签管理</el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
        </el-menu>
      </el-scrollbar>
    </el-aside>

    <el-container>
      <el-header style="text-align: right; font-size: 12px">
        <div class="toolbar">
          <el-dropdown>
            <el-icon style="margin-right: 8px; margin-top: 1px"
            >
              <setting
              />
            </el-icon>
            <template #dropdown>
              <el-dropdown-menu>
                <el-dropdown-item @click="logout">退出登录</el-dropdown-item>
              </el-dropdown-menu>
            </template>
          </el-dropdown>
          <span>{{ nickname }}</span>
        </div>
      </el-header>

      <el-main>
        <el-scrollbar>
          <div v-if="isFirst">
            <el-table v-if="isCheckShop === true && isFirst" :data="shopList" tabindex="index" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="shopName" label="店铺名称" width="180"/>
              <el-table-column label="店铺图片" width="220" prop="picture">
                <template #default="scope">
                  <div style="width: 110px;height: 110px;display: flex;align-items: center;">
                    <el-image fit="fill" :src="scope.row.picture"></el-image>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="shopDescription" label="店铺描述" width="400"/>
              <el-table-column prop="shopPosition" label="店铺位置" width="120"/>
              <el-table-column prop="floor" label="店铺楼层" width="120"/>
              <el-table-column prop="shopAddress" label="店铺地址" width="120"/>
              <el-table-column prop="workTime" label="营业时间" width="120"/>
              <el-table-column fixed="right" label="审核操作" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="openAgree(row.id, null)"
                  >通过
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="openReject(row.id)">不通过</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckFinance === true && isFirst" :data="financeList" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="shopId" label="投诉店铺id" width="180"/>
              <el-table-column fixed prop="userId" label="投诉用户id" width="180"/>
              <el-table-column prop="shopName" label="店铺名称" width="200"/>
              <el-table-column prop="content" label="投诉内容" width="420"/>
              <el-table-column fixed="right" label="审核操作" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="openAgree(row.id, null)"
                  >通过
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="openReject(row.id)">不通过</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckComplaint === true && isFirst" :data="complaintList" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="shopId" label="投诉店铺id" width="180"/>
              <el-table-column fixed prop="userId" label="投诉用户id" width="180"/>
              <el-table-column prop="shopName" label="店铺名称" width="200"/>
              <el-table-column prop="content" label="投诉内容" width="420"/>
              <el-table-column fixed="right" label="审核操作" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="openAgree(row.id, null)"
                  >通过
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="openReject(row.id)">不通过</el-button>
                </template>
              </el-table-column>
            </el-table>
            <div>
              <el-button v-if="isCheckAddCoupon === true && isFirst" type="primary" @click="addCoupon">点击新增优惠券
              </el-button>
            </div>
            <div>
              <el-table v-if="isCheckCoupon === true && isFirst" :data="couponList" style="width: 100%">
                <el-table-column fixed prop="id" label="Id" width="180"/>
                <el-table-column fixed prop="shopId" label="优惠券店铺id" width="180"/>
                <el-table-column fixed prop="amount" label="可抵金额" width="180"/>
                <el-table-column prop="price" label="优惠券价格" width="180"/>
                <el-table-column prop="number" label="优惠券数量" width="180"/>
                <el-table-column fixed="right" label="审核操作" width="120">
                  <template #default="{row}">
                    <el-button link type="primary" size="small" @click="openAgree(row.id, row.shopId)"
                    >通过
                    </el-button
                    >
                    <el-button link type="primary" size="small" @click="openReject(row.id)">不通过</el-button>
                  </template>
                </el-table-column>
              </el-table>
            </div>
            <div>
              <el-table v-if="isCheckShopCoupon === true && isFirst" :data="shopCouponList" style="width: 100%">
                <el-table-column fixed prop="id" label="Id" width="180"/>
                <el-table-column fixed prop="shopId" label="优惠券店铺id" width="180"/>
                <el-table-column fixed prop="amount" label="可抵金额" width="180"/>
                <el-table-column prop="price" label="优惠券价格" width="180"/>
                <el-table-column prop="number" label="优惠券数量" width="180"/>
                <el-table-column fixed="right" label="审核操作" width="120">
                  <template #default="{row}">
                    <el-button link type="primary" size="small" @click="openAgree(row.id, row.shopId)"
                    >通过
                    </el-button
                    >
                    <el-button link type="primary" size="small" @click="openReject(row.id)">不通过</el-button>
                  </template>
                </el-table-column>
              </el-table>
            </div>
            <el-table v-if="isCheckAdvertisement === true && isFirst" :data="advertisementList" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="title" label="广告标题" width="180"/>
              <el-table-column label="广告图片" width="220" prop="picture">
                <template #default="scope">
                  <div style="width: 110px;height: 110px;display: flex;align-items: center;">
                    <el-image fit="fill" :src="scope.row.picture"></el-image>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="price" label="广告价格" width="400"/>
              <el-table-column fixed="right" label="审核操作" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="openAgree(row.id, null)"
                  >通过
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="openReject(row.id)">不通过</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckAdminAdvertisement === true && isFirst" :data="adminAdvertisementList"
                      style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="title" label="广告标题" width="180"/>
              <el-table-column label="广告图片" width="220" prop="picture">
                <template #default="scope">
                  <div style="width: 110px;height: 110px;display: flex;align-items: center;">
                    <el-image fit="fill" :src="scope.row.picture"></el-image>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="price" label="广告价格" width="400"/>
              <el-table-column fixed="right" label="审核操作" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="openAgree(row.id, null)"
                  >通过
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="openReject(row.id)">不通过</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckComplianceShop === true && isFirst" :data="ComplianceShopList" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="shopName" label="店铺名称" width="180"/>
              <el-table-column label="店铺图片" width="220" prop="picture">
                <template #default="scope">
                  <div style="width: 110px;height: 110px;display: flex;align-items: center;">
                    <el-image fit="fill" :src="scope.row.picture"></el-image>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="shopDescription" label="店铺描述" width="400"/>
              <el-table-column prop="shopPosition" label="店铺位置" width="120"/>
              <el-table-column prop="floor" label="店铺楼层" width="120"/>
              <el-table-column prop="shopAddress" label="店铺地址" width="120"/>
              <el-table-column prop="workTime" label="营业时间" width="120"/>
              <el-table-column fixed="right" label="审核操作" width="220">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="openAgree(row.id, null)"
                  >通过
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="openReject(row.id)">不通过</el-button>
                  <el-button link type="primary" size="small" @click="checkDish(row.id)">查看菜品</el-button>
                </template>
              </el-table-column>
            </el-table>
            <div v-if="isCheckDish === true && isFirst">
              <el-button style="padding-left: 1500px; padding-top: 20px" link type="primary" size="large" @click="back">
                返回
              </el-button>
              <el-table :data="DishList" style="width: 100%">
                <el-table-column fixed prop="id" label="Id" width="180"/>
                <el-table-column label="菜品图片" width="220" prop="picture">
                  <template #default="scope">
                    <div style="width: 110px;height: 110px;display: flex;align-items: center;">
                      <el-image fit="fill" :src="scope.row.picture"></el-image>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column fixed prop="dishName" label="菜品名称" width="180"/>
                <el-table-column prop="dishDescription" label="菜品描述" width="400"/>
                <el-table-column prop="dishPrice" label="菜品价格" width="120"/>
                <el-table-column prop="dishFlavor" label="菜品口味" width="120"/>
              </el-table>
            </div>
          </div>




          <div>
            <el-table v-if="isCheckOne === true && isTwo" :data="ListOne" tabindex="index" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="nickname" label="昵称" width="180"/>
              <el-table-column label="头像" width="220" prop="picture">
                <template #default="scope">
                  <div style="width: 110px;height: 110px;display: flex;align-items: center;">
                    <el-image fit="fill" :src="scope.row.avatar"></el-image>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="user_account" label="账号" width="400"/>
              <el-table-column prop="name" label="姓名" width="120"/>
              <el-table-column prop="phone" label="电话号码" width="120"/>
              <el-table-column prop="email" label="邮箱" width="120"/>
              <el-table-column prop="address" label="地址" width="120"/>
              <el-table-column prop="gender" label="性别" width="120"/>
              <el-table-column prop="stuNum" label="学号" width="120"/>
              <el-table-column prop="userRole" label="用户角色" width="120"/>
              <el-table-column prop="createTime" label="创建时间" width="120"/>
              <el-table-column prop="updateTime" label="更新时间" width="120"/>
              <el-table-column fixed="right" label="操作项" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="edit(row.id, null)"
                  >编辑
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="deleted(row.id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckTwo === true && isTwo" :data="ListTwo" tabindex="index" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="shopName" label="店铺名称" width="180"/>
              <el-table-column label="店铺图片" width="220" prop="picture">
                <template #default="scope">
                  <div style="width: 110px;height: 110px;display: flex;align-items: center;">
                    <el-image fit="fill" :src="scope.row.picture"></el-image>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="shopDescription" label="店铺描述" width="400"/>
              <el-table-column prop="shopAddress" label="店铺位置" width="120"/>
              <el-table-column prop="floor" label="店铺楼层" width="120"/>
              <el-table-column prop="shopAddress" label="店铺地址" width="120"/>
              <el-table-column prop="shopScore" label="店铺评分" width="120"/>
              <el-table-column prop="workTime" label="营业时间" width="120"/>
              <el-table-column prop="createTime" label="创建时间" width="120"/>
              <el-table-column prop="updateTime" label="更新时间" width="120"/>
              <el-table-column fixed="right" label="操作项" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="edit(row.id, null)"
                  >编辑
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="deleted(row.id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckThree === true && isTwo" :data="ListThree" tabindex="index" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="senderId" label="发送者Id" width="180"/>
              <el-table-column prop="receiverId" label="接收者Id" width="400"/>
              <el-table-column prop="content" label="内容" width="120"/>
              <el-table-column prop="isImg" label="是否是图片" width="120"/>
              <el-table-column prop="isRead" label="是否已读" width="120"/>
              <el-table-column prop="isAi" label="是否是AI" width="120"/>
              <el-table-column prop="createTime" label="创建时间" width="120"/>
              <el-table-column prop="updateTime" label="更新时间" width="120"/>
              <el-table-column fixed="right" label="操作项" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="edit(row.id, null)"
                  >编辑
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="deleted(row.id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckFour === true && isTwo" :data="ListFour" tabindex="index" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="userId" label="用户Id" width="180"/>
              <el-table-column prop="shopId" label="店铺Id" width="400"/>
              <el-table-column prop="commentContent" label="评论内容" width="120"/>
              <el-table-column prop="createTime" label="创建时间" width="120"/>
              <el-table-column prop="updateTime" label="更新时间" width="120"/>
              <el-table-column fixed="right" label="操作项" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="edit(row.id, null)"
                  >编辑
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="deleted(row.id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckFive === true && isTwo" :data="ListFive" tabindex="index" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="userId" label="用户Id" width="180"/>
              <el-table-column prop="shopId" label="店铺Id" width="400"/>
              <el-table-column prop="content" label="投诉内容" width="120"/>
              <el-table-column prop="status" label="投诉状态" width="120"/>
              <el-table-column prop="createTime" label="创建时间" width="120"/>
              <el-table-column prop="updateTime" label="更新时间" width="120"/>
              <el-table-column fixed="right" label="操作项" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="edit(row.id, null)"
                  >编辑
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="deleted(row.id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckSix === true && isTwo" :data="ListSix" tabindex="index" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="shopId" label="店铺Id" width="180"/>
              <el-table-column prop="amount" label="可抵金额" width="400"/>
              <el-table-column prop="price" label="优惠券价格" width="120"/>
              <el-table-column prop="number" label="优惠券数量" width="120"/>
              <el-table-column prop="status" label="优惠券状态" width="120"/>
              <el-table-column prop="createTime" label="创建时间" width="120"/>
              <el-table-column prop="updateTime" label="更新时间" width="120"/>
              <el-table-column fixed="right" label="操作项" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="edit(row.id, null)"
                  >编辑
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="deleted(row.id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckSeven === true && isTwo" :data="ListSeven" tabindex="index" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="dishName" label="菜品名称" width="180"/>
              <el-table-column label="菜品图片" width="220" prop="picture">
                <template #default="scope">
                  <div style="width: 110px;height: 110px;display: flex;align-items: center;">
                    <el-image fit="fill" :src="scope.row.picture"></el-image>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="dishDescription" label="菜品描述" width="400"/>
              <el-table-column prop="dishPrice" label="菜品价格" width="120"/>
              <el-table-column prop="dishFlavor" label="菜品口味" width="120"/>
              <el-table-column prop="shopId" label="店铺Id" width="120"/>
              <el-table-column prop="createTime" label="创建时间" width="120"/>
              <el-table-column prop="updateTime" label="更新时间" width="120"/>
              <el-table-column fixed="right" label="操作项" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="edit(row.id, null)"
                  >编辑
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="deleted(row.id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckEight === true && isTwo" :data="ListEight" tabindex="index" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="receiverId" label="接收者Id" width="180"/>
              <el-table-column prop="content" label="消息内容" width="400"/>
              <el-table-column prop="isCheck" label="是否是审核消息" width="120"/>
              <el-table-column prop="createTime" label="创建时间" width="120"/>
              <el-table-column prop="updateTime" label="更新时间" width="120"/>
              <el-table-column fixed="right" label="操作项" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="edit(row.id, null)"
                  >编辑
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="deleted(row.id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckNine === true && isTwo" :data="ListNine" tabindex="index" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="title" label="操作标题" width="180"/>
              <el-table-column label="操作图片" width="220" prop="picture">
                <template #default="scope">
                  <div style="width: 110px;height: 110px;display: flex;align-items: center;">
                    <el-image fit="fill" :src="scope.row.picture"></el-image>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="createTime" label="创建时间" width="400"/>
              <el-table-column prop="updateTime" label="更新时间" width="120"/>
              <el-table-column fixed="right" label="操作项" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="edit(row.id, null)"
                  >编辑
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="deleted(row.id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckTen === true && isTwo" :data="ListTen" tabindex="index" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="userId" label="用户Id" width="180"/>
              <el-table-column prop="postContent" label="帖子内容" width="400"/>
              <el-table-column prop="postAddress" label="发帖位置" width="120"/>
              <el-table-column prop="tagList" label="标签" width="120"/>
              <el-table-column prop="createTime" label="创建时间" width="120"/>
              <el-table-column prop="updateTime" label="更新时间" width="120"/>
              <el-table-column fixed="right" label="操作项" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="edit(row.id, null)"
                  >编辑
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="deleted(row.id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckEleven === true && isTwo" :data="ListEleven" tabindex="index" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="actClassName" label="帖子分类名称" width="180"/>
              <el-table-column label="分类图片" width="220" prop="picture">
                <template #default="scope">
                  <div style="width: 110px;height: 110px;display: flex;align-items: center;">
                    <el-image fit="fill" :src="scope.row.picture"></el-image>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="createTime" label="创建时间" width="400"/>
              <el-table-column prop="updateTime" label="更新时间" width="120"/>
              <el-table-column fixed="right" label="操作项" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="edit(row.id, null)"
                  >编辑
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="deleted(row.id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckTwelve === true && isTwo" :data="ListTwelve" tabindex="index" style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="userId" label="用户Id" width="180"/>
              <el-table-column prop="postId" label="帖子Id" width="400"/>
              <el-table-column prop="commentContent" label="评论内容" width="120"/>
              <el-table-column prop="createTime" label="创建时间" width="120"/>
              <el-table-column prop="updateTime" label="更新时间" width="120"/>
              <el-table-column fixed="right" label="操作项" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="edit(row.id, null)"
                  >编辑
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="deleted(row.id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckThirteen === true && isTwo" :data="ListThirteen" tabindex="index"
                      style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="title" label="轮播图标题" width="180"/>
              <el-table-column label="轮播图图片" width="220" prop="picture">
                <template #default="scope">
                  <div style="width: 110px;height: 110px;display: flex;align-items: center;">
                    <el-image fit="fill" :src="scope.row.picture"></el-image>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="createTime" label="创建时间" width="400"/>
              <el-table-column prop="updateTime" label="更新时间" width="120"/>
              <el-table-column fixed="right" label="操作项" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="edit(row.id, null)"
                  >编辑
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="deleted(row.id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table v-if="isCheckFourteen === true && isTwo" :data="ListFourteen" tabindex="index"
                      style="width: 100%">
              <el-table-column fixed prop="id" label="Id" width="180"/>
              <el-table-column fixed prop="name" label="标签名称" width="180"/>
              <el-table-column prop="classId" label="分类Id" width="400"/>
              <el-table-column prop="createTime" label="创建时间" width="120"/>
              <el-table-column prop="updateTime" label="更新时间" width="120"/>
              <el-table-column fixed="right" label="操作项" width="120">
                <template #default="{row}">
                  <el-button link type="primary" size="small" @click="edit(row.id, null)"
                  >编辑
                  </el-button
                  >
                  <el-button link type="primary" size="small" @click="deleted(row.id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>

        </el-scrollbar>
      </el-main>
    </el-container>
  </el-container>
  <div style="margin-left: 600px; padding-top: 20px">
    <el-pagination background layout="prev, pager, next" :total="1000" @current-change="handlePageChange"/>
  </div>

</template>

<script lang="ts" setup>
import {ElMessage, ElMessageBox} from 'element-plus'
import {
  Iphone,
  Location,
  OfficeBuilding,
  Tickets,
  User, Menu as IconMenu, Message, Setting, View
} from '@element-plus/icons-vue'
import api from '../api/api';
import {computed, onMounted, ref} from 'vue'
import AddForm from './AddForm.vue';
import {useRouter} from "vue-router";
import {create} from "axios";

const router = useRouter();

const isCheckShop = ref(false)
const shopList = ref([])
const complaintList = ref([])
const couponList = ref([])
const advertisementList = ref([])
const adminAdvertisementList = ref([])
const ComplianceShopList = ref([])
const DishList = ref([])
const shopCouponList = ref([])
const financeList = ref([])
const ListOne = ref([])
const ListTwo = ref([])
const ListThree = ref([])
const ListFour = ref([])
const ListFive = ref([])
const ListSix = ref([])
const ListSeven = ref([])
const ListEight = ref([])
const ListNine = ref([])
const ListTen = ref([])
const ListEleven = ref([])
const ListTwelve = ref([])
const ListThirteen = ref([])
const ListFourteen = ref([])
const page = ref(1)
const length = ref(10)
const isCheckComplaint = ref(false)
const isCheckFinance = ref(false)
const isCheckCoupon = ref(false)
const isCheckAdvertisement = ref(false)
const isCheckAdminAdvertisement = ref(false)
const isCheckComplianceShop = ref(false)
const isCheckDish = ref(false)
const isCheckShopCoupon = ref(false)
const isCheckAddCoupon = ref(false)
const isCheckOne = ref(false)
const isCheckTwo = ref(false)
const isCheckThree = ref(false)
const isCheckFour = ref(false)
const isCheckFive = ref(false)
const isCheckSix = ref(false)
const isCheckSeven = ref(false)
const isCheckEight = ref(false)
const isCheckNine = ref(false)
const isCheckTen = ref(false)
const isCheckEleven = ref(false)
const isCheckTwelve = ref(false)
const isCheckThirteen = ref(false)
const isCheckFourteen = ref(false)
const isFirst = ref(true)
const isTwo = ref(false)
const current = ref("")
const userRole = ref("")
const nickname = ref("")
const handlePageChange = (newPage) => {
  console.log('当前页码变为: ', newPage);
  page.value = newPage
  if (current.value === "店铺") {
    checkShop();
  } else if (current.value === "投诉") {
    checkFinance();
  } else if (current.value === "优惠券") {
    checkCoupon();
  } else if (current.value === "广告") {
    checkAdvertisement();
  } else if (current.value === "管理员审核广告") {
    checkAdminAdvertisement();
  } else if (current.value === "管理员审核广告") {
    checkAdminAdvertisement()
  } else if (current.value === "店铺合规查询") {
    checkComplianceShop();
  } else if (current.value === "商家二次审核") {
    checkShopCoupon();
  } else if (current.value === "投诉合规审核") {
    checkShopCoupon();
  } else if (current.value === "one") {
    openOne();
  } else if (current.value === "two") {
    openTwo();
  } else if (current.value === "three") {
    openThree();
  } else if (current.value === "four") {
    openFour();
  } else if (current.value === "five") {
    openFive();
  } else if (current.value === "six") {
    openSix();
  } else if (current.value === "seven") {
    openSeven();
  } else if (current.value === "eight") {
    openEight();
  } else if (current.value === "nine") {
    openNine();
  } else if (current.value === "ten") {
    openTen();
  } else if (current.value === "eleven") {
    openEleven();
  } else if (current.value === "twelve") {
    openTwelve();
  } else if (current.value === "thirteen") {
    openThirteen();
  } else if (current.value === "fourteen") {
    openFourteen();
  }
};
onMounted(() => {
  getUserInfo();
})

const deleted = (id) => {
  ElMessageBox.confirm(
      '确认删除?',
      'Warning',
      {
        confirmButtonText: 'OK',
        cancelButtonText: 'Cancel',
        type: 'warning',
      }
  )
      .then(() => {
        if (current.value === "one") {
          api.get('/api/user/deleteUser?userId=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '删除成功',
            })
            openOne();
          }))

        } else if (current.value === "two"){
          api.get('/api/shop/deleteShopByMp?shopId=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '删除成功',
            })
            openTwo();
          }))

        } else if (current.value === "three"){
          api.get('/api/chat/deleteChatByMp?chatId=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '删除成功',
            })
            openThree()
          }))
        } else if (current.value === "four"){
          api.get('/api/comment/deleteCommentByMp?commentId=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '删除成功',
            })
            openFour();
          }))
        } else if (current.value === "five"){
          api.get('/api/complaint/deleteComplaintByMp?complaintId=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '删除成功',
            })
            openFive()
          }))
        } else if (current.value === "six"){
          api.get('/api/coupon/deleteCouponByMp?couponId=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '删除成功',
            })
            openSix()
          }))
        } else if (current.value === "seven"){
          api.get('/api/dish/deleteDishByMp?dishId=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '删除成功',
            })
            openSeven()
          }))
        } else if (current.value === "eight"){
          api.get('/api/message/deleteMessageByMp?messageId=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '删除成功',
            })
            openEight()
          }))
        } else if (current.value === "nine"){
          api.get('/api/operation/deleteOperationByMp?operationId=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '删除成功',
            })
            openNine()
          }))
        } else if (current.value === "ten"){
          api.get('/api/post/deletePostByMp?postId=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '删除成功',
            })
            openTen()
          }))
        } else if (current.value === "eleven"){
          api.get('/api/postActClass/deletePostActClassByMp?postActClassId=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '删除成功',
            })
            openEleven()
          }))
        } else if (current.value === "twelve"){
          api.get('/api/postComment/deletePostCommentByMp?postCommentId=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '删除成功',
            })
            openTwelve()
          }))
        } else if (current.value === "thirteen"){
          api.get('/api/rotation/deleteRotationChartByMp?rotationChartId=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '删除成功',
            })
            openThirteen()
          }))
        } else if (current.value === "fourteen"){
          api.get('/api/tag/deleteTagByMp?tagId=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '删除成功',
            })
            openFourteen()
          }))
        }
      })

}
const openOne = () => {
  current.value = "one";
  isFirst.value = false;
  isTwo.value = true;
  isCheckOne.value = true;
  isCheckTwo.value = false;
  isCheckThree.value = false;
  isCheckFour.value = false;
  isCheckFive.value = false;
  isCheckSix.value = false;
  isCheckSeven.value = false;
  isCheckEight.value = false;
  isCheckNine.value = false;
  isCheckTen.value = false;
  isCheckEleven.value = false;
  isCheckTwelve.value = false;
  isCheckThirteen.value = false;
  isCheckFourteen.value = false;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/user/searchUserByMp', data).then((response => {
    ListOne.value = response.result
  }))
}
const openTwo = () => {
  current.value = "two";
  isCheckOne.value = false;
  isFirst.value = false;
  isTwo.value = true;
  isCheckTwo.value = true;
  isCheckThree.value = false;
  isCheckFour.value = false;
  isCheckFive.value = false;
  isCheckSix.value = false;
  isCheckSeven.value = false;
  isCheckEight.value = false;
  isCheckNine.value = false;
  isCheckTen.value = false;
  isCheckEleven.value = false;
  isCheckTwelve.value = false;
  isCheckThirteen.value = false;
  isCheckFourteen.value = false;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/shop/searchShopByMp', data).then((response => {
    ListTwo.value = response.result
  }))
}
const openThree = () => {
  current.value = "three";
  isCheckOne.value = false;
  isFirst.value = false;
  isTwo.value = true;
  isCheckTwo.value = false;
  isCheckThree.value = true;
  isCheckFour.value = false;
  isCheckFive.value = false;
  isCheckSix.value = false;
  isCheckSeven.value = false;
  isCheckEight.value = false;
  isCheckNine.value = false;
  isCheckTen.value = false;
  isCheckEleven.value = false;
  isCheckTwelve.value = false;
  isCheckThirteen.value = false;
  isCheckFourteen.value = false;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/chat/searchChatByMp', data).then((response => {
    ListThree.value = response.result
  }))
}
const openFour = () => {
  current.value = "four";
  isCheckOne.value = false;
  isFirst.value = false;
  isTwo.value = true;
  isCheckTwo.value = false;
  isCheckThree.value = false;
  isCheckFour.value = true;
  isCheckFive.value = false;
  isCheckSix.value = false;
  isCheckSeven.value = false;
  isCheckEight.value = false;
  isCheckNine.value = false;
  isCheckTen.value = false;
  isCheckEleven.value = false;
  isCheckTwelve.value = false;
  isCheckThirteen.value = false;
  isCheckFourteen.value = false;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/comment/searchCommentByMp', data).then((response => {
    ListFour.value = response.result
  }))
}
const openFive = () => {
  current.value = "five";
  isCheckOne.value = false;
  isFirst.value = false;
  isTwo.value = true;
  isCheckTwo.value = false;
  isCheckThree.value = false;
  isCheckFour.value = false;
  isCheckFive.value = true;
  isCheckSix.value = false;
  isCheckSeven.value = false;
  isCheckEight.value = false;
  isCheckNine.value = false;
  isCheckTen.value = false;
  isCheckEleven.value = false;
  isCheckTwelve.value = false;
  isCheckThirteen.value = false;
  isCheckFourteen.value = false;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/complaint/searchComplaintByMp', data).then((response => {
    ListFive.value = response.result
  }))
}
const openSix = () => {
  current.value = "six";
  isCheckOne.value = false;
  isFirst.value = false;
  isTwo.value = true;
  isCheckTwo.value = false;
  isCheckThree.value = false;
  isCheckFour.value = false;
  isCheckFive.value = false;
  isCheckSix.value = true;
  isCheckSeven.value = false;
  isCheckEight.value = false;
  isCheckNine.value = false;
  isCheckTen.value = false;
  isCheckEleven.value = false;
  isCheckTwelve.value = false;
  isCheckThirteen.value = false;
  isCheckFourteen.value = false;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/coupon/searchCouponByMp', data).then((response => {
    ListSix.value = response.result
  }))
}
const openSeven = () => {
  current.value = "seven";
  isCheckOne.value = false;
  isFirst.value = false;
  isTwo.value = true;
  isCheckTwo.value = false;
  isCheckThree.value = false;
  isCheckFour.value = false;
  isCheckFive.value = false;
  isCheckSix.value = false;
  isCheckSeven.value = true;
  isCheckEight.value = false;
  isCheckNine.value = false;
  isCheckTen.value = false;
  isCheckEleven.value = false;
  isCheckTwelve.value = false;
  isCheckThirteen.value = false;
  isCheckFourteen.value = false;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/dish/searchDishByMp', data).then((response => {
    ListSeven.value = response.result
  }))
}
const openEight = () => {
  current.value = "eight";
  isCheckOne.value = false;
  isFirst.value = false;
  isTwo.value = true;
  isCheckTwo.value = false;
  isCheckThree.value = false;
  isCheckFour.value = false;
  isCheckFive.value = false;
  isCheckSix.value = false;
  isCheckSeven.value = false;
  isCheckEight.value = true;
  isCheckNine.value = false;
  isCheckTen.value = false;
  isCheckEleven.value = false;
  isCheckTwelve.value = false;
  isCheckThirteen.value = false;
  isCheckFourteen.value = false;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/message/searchMessageByMp', data).then((response => {
    ListEight.value = response.result
  }))
}
const openNine = () => {
  current.value = "nine";
  isCheckOne.value = false;
  isFirst.value = false;
  isTwo.value = true;
  isCheckTwo.value = false;
  isCheckThree.value = false;
  isCheckFour.value = false;
  isCheckFive.value = false;
  isCheckSix.value = false;
  isCheckSeven.value = false;
  isCheckEight.value = false;
  isCheckNine.value = true;
  isCheckTen.value = false;
  isCheckEleven.value = false;
  isCheckTwelve.value = false;
  isCheckThirteen.value = false;
  isCheckFourteen.value = false;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/operation/searchOperationByMp', data).then((response => {
    ListNine.value = response.result
  }))
}
const openTen = () => {
  current.value = "ten";
  isCheckOne.value = false;
  isFirst.value = false;
  isTwo.value = true;
  isCheckTwo.value = false;
  isCheckThree.value = false;
  isCheckFour.value = false;
  isCheckFive.value = false;
  isCheckSix.value = false;
  isCheckSeven.value = false;
  isCheckEight.value = false;
  isCheckNine.value = false;
  isCheckTen.value = true;
  isCheckEleven.value = false;
  isCheckTwelve.value = false;
  isCheckThirteen.value = false;
  isCheckFourteen.value = false;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/post/searchPostByMp', data).then((response => {
    ListTen.value = response.result
  }))
}
const openEleven = () => {
  current.value = "eleven";
  isCheckOne.value = false;
  isFirst.value = false;
  isTwo.value = true;
  isCheckTwo.value = false;
  isCheckThree.value = false;
  isCheckFour.value = false;
  isCheckFive.value = false;
  isCheckSix.value = false;
  isCheckSeven.value = false;
  isCheckEight.value = false;
  isCheckNine.value = false;
  isCheckTen.value = false;
  isCheckEleven.value = true;
  isCheckTwelve.value = false;
  isCheckThirteen.value = false;
  isCheckFourteen.value = false;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/postActClass/searchPostActClassByMp', data).then((response => {
    ListEleven.value = response.result
  }))
}
const openTwelve = () => {
  current.value = "twelve";
  isCheckOne.value = false;
  isFirst.value = false;
  isTwo.value = true;
  isCheckTwo.value = false;
  isCheckThree.value = false;
  isCheckFour.value = false;
  isCheckFive.value = false;
  isCheckSix.value = false;
  isCheckSeven.value = false;
  isCheckEight.value = false;
  isCheckNine.value = false;
  isCheckTen.value = false;
  isCheckEleven.value = false;
  isCheckTwelve.value = true;
  isCheckThirteen.value = false;
  isCheckFourteen.value = false;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/postComment/searchPostCommentByMp', data).then((response => {
    ListTwelve.value = response.result
  }))
}
const openThirteen = () => {
  current.value = "thirteen";
  isCheckOne.value = false;
  isFirst.value = false;
  isTwo.value = true;
  isCheckTwo.value = false;
  isCheckThree.value = false;
  isCheckFour.value = false;
  isCheckFive.value = false;
  isCheckSix.value = false;
  isCheckSeven.value = false;
  isCheckEight.value = false;
  isCheckNine.value = false;
  isCheckTen.value = false;
  isCheckEleven.value = false;
  isCheckTwelve.value = false;
  isCheckThirteen.value = true;
  isCheckFourteen.value = false;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/rotation/searchRotationChartByMp', data).then((response => {
    ListThirteen.value = response.result
  }))
}
const openFourteen = () => {
  current.value = "fourteen";
  isCheckOne.value = false;
  isFirst.value = false;
  isTwo.value = true;
  isCheckTwo.value = false;
  isCheckThree.value = false;
  isCheckFour.value = false;
  isCheckFive.value = false;
  isCheckSix.value = false;
  isCheckSeven.value = false;
  isCheckEight.value = false;
  isCheckNine.value = false;
  isCheckTen.value = false;
  isCheckEleven.value = false;
  isCheckTwelve.value = false;
  isCheckThirteen.value = false;
  isCheckFourteen.value = true;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/tag/searchTagByMp', data).then((response => {
    ListFourteen.value = response.result
  }))
}

const logout = () => {
  localStorage.removeItem("token");
  router.push('/Login')
}
const getUserInfo = () => {
  api.get('/api/user/getLoginUser', null).then((response => {
    console.log(response.result.userRole)
    userRole.value = response.result.userRole
    nickname.value = response.result.nickname
    // location.reload();
  }))
}
const addCoupon = () => {
  router.push('/AddForm')
}
const back = () => {
  checkComplianceShop()
}
const openAgree = (id, shopId) => {
  console.log(id)
  ElMessageBox.confirm(
      '确认审核通过?',
      'Warning',
      {
        confirmButtonText: 'OK',
        cancelButtonText: 'Cancel',
        type: 'warning',
      }
  )
      .then(() => {
        if (current.value === "店铺") {
          api.get('/api/shop/agreeShop?id=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '已通过',
            })
            checkShop();
          }))
        } else if (current.value === "投诉") {
          api.get('/api/complaint/agreeComplaint?id=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '已通过',
            })
            checkFinance();
          }))
        } else if (current.value === "优惠券") {
          api.get('/api/coupon/agreeCoupon?id=' + id + '&shopId=' + shopId, null).then((response => {
            ElMessage({
              type: 'success',
              message: '已通过',
            })
            checkCoupon();
          }))
        } else if (current.value === "广告") {
          api.get('/api/advertisement/agreeAdvertisement?id=' + id, null).then((response => {
            ElMessage({
              type: 'success',
              message: '已通过',
            })
            checkAdvertisement();
          }))
        } else if (current.value === "管理员审核广告") {
          const data = {
            id: id,
            status: '已通过'
          }
          api.post('/api/advertisement/updateAdvertisementStatus', data).then((response => {
            ElMessage({
              type: 'success',
              message: '已通过',
            })
            checkAdminAdvertisement();
          }))
        } else if (current.value === "店铺合规查询") {
          const data = {
            shopId: id,
            status: '已通过'
          }
          api.post('/api/shop/updateShopStatus', data).then((response => {
            ElMessage({
              type: 'success',
              message: '已通过',
            })
            checkComplianceShop();
          }))
        } else if (current.value === "商家二次审核") {
          const data = {
            id: id,
            status: '已通过'
          }
          api.post('/api/coupon/updateCouponStatus', data).then((response => {
            ElMessage({
              type: 'success',
              message: '已通过',
            })
            checkShopCoupon();
          }))
        } else if (current.value === "投诉合规审核") {
          const data = {
            id: id,
            status: '已初审'
          }
          api.post('/api/complaint/updateComplaintStatus', data).then((response => {
            ElMessage({
              type: 'success',
              message: '已通过',
            })
            checkComplaint();
          }))
        }
      })
      .catch(() => {
        // ElMessage({
        //   type: 'info',
        //   message: 'Delete canceled',
        // })
      })
}
const checkAddCoupon = () => {
  current.value = "添加优惠券"
  console.log(current.value)
  isFirst.value = true;
  isTwo.value = false;
  isCheckShop.value = false;
  isCheckFinance.value = false;
  isCheckComplaint.value = false;
  isCheckCoupon.value = false;
  isCheckAdvertisement.value = false;
  isCheckAdminAdvertisement.value = false;
  isCheckComplianceShop.value = false;
  isCheckDish.value = false;
  isCheckShopCoupon.value = false;
  isCheckAddCoupon.value = true;
}
const checkShopCoupon = () => {
  current.value = "商家二次审核"
  console.log(current.value)
  isFirst.value = true;
  isTwo.value = false;
  isCheckShop.value = false;
  isCheckFinance.value = false;
  isCheckComplaint.value = false;
  isCheckCoupon.value = false;
  isCheckAdvertisement.value = false;
  isCheckAdminAdvertisement.value = false;
  isCheckComplianceShop.value = false;
  isCheckDish.value = false;
  isCheckAddCoupon.value = false;
  isCheckShopCoupon.value = true;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/coupon/searchBusinessCheckByPage', data).then((response => {
    shopCouponList.value = response.result
  }))
}
const checkDish = (id) => {
  current.value = "菜品查询"
  console.log(current.value)
  isFirst.value = true;
  isTwo.value = false;
  isCheckShop.value = false;
  isCheckFinance.value = false;
  isCheckComplaint.value = false;
  isCheckCoupon.value = false;
  isCheckAdvertisement.value = false;
  isCheckAdminAdvertisement.value = false;
  isCheckComplianceShop.value = false;
  isCheckShopCoupon.value = false;
  isCheckAddCoupon.value = false;
  isCheckDish.value = true;
  const data = {
    start: 1,
    length: 100,
    shopId: id
  }
  api.post('/api/dish/searchDishesByShopId', data).then((response => {
    DishList.value = response.result;
  }))
}
const openReject = (id) => {
  console.log(id)
  ElMessageBox.confirm(
      '确认审核不通过?',
      'Warning',
      {
        confirmButtonText: 'OK',
        cancelButtonText: 'Cancel',
        type: 'warning',
      }
  )
      .then(() => {
        if (current.value === "店铺") {
          api.get('/api/shop/rejectShop?id=' + id, null).then((response => {
            ElMessage({
              type: 'warning',
              message: '已拒绝',
            })
            checkShop();
          }))
        } else if (current.value === "投诉") {
          api.get('/api/complaint/rejectComplaint?id=' + id, null).then((response => {
            ElMessage({
              type: 'warning',
              message: '已拒绝',
            })
            checkFinance();
          }))
        } else if (current.value === "优惠券") {
          api.get('/api/coupon/rejectCoupon?id=' + id, null).then((response => {
            ElMessage({
              type: 'warning',
              message: '已拒绝',
            })
            checkCoupon();
          }))
        } else if (current.value === "广告") {
          api.get('/api/advertisement/rejectAdvertisement?id=' + id, null).then((response => {
            ElMessage({
              type: 'warning',
              message: '已拒绝',
            })
            checkAdvertisement();
          }))
        } else if (current.value === "管理员审核广告") {
          const data = {
            id: id,
            status: '已拒绝'
          }
          api.post('/api/advertisement/updateAdvertisementStatus', data).then((response => {
            ElMessage({
              type: 'warning',
              message: '已拒绝',
            })
            checkAdminAdvertisement();
          }))
        } else if (current.value === "店铺合规查询") {
          const data = {
            shopId: id,
            status: '已拒绝'
          }
          api.post('/api/shop/updateShopStatus', data).then((response => {
            ElMessage({
              type: 'warning',
              message: '已拒绝',
            })
            checkComplianceShop();
          }))
        } else if (current.value === "商家二次审核") {
          const data = {
            id: id,
            status: '已拒绝'
          }
          api.post('/api/coupon/updateCouponStatus', data).then((response => {
            ElMessage({
              type: 'warning',
              message: '已拒绝',
            })
            checkShopCoupon();
          }))
        } else if (current.value === "投诉合规审核") {
          const data = {
            id: id,
            status: '已拒绝'
          }
          api.post('/api/complaint/updateComplaintStatus', data).then((response => {
            ElMessage({
              type: 'warning',
              message: '已拒绝',
            })
            checkComplaint()
          }))
        }
      })
      .catch(() => {
        // ElMessage({
        //   type: 'info',
        //   message: 'Delete canceled',
        // })
      })
}
const checkComplianceShop = () => {
  current.value = "店铺合规查询"
  console.log(current.value)
  isFirst.value = true;
  isTwo.value = false;
  isCheckShop.value = false;
  isCheckFinance.value = false;
  isCheckComplaint.value = false;
  isCheckCoupon.value = false;
  isCheckAdvertisement.value = false;
  isCheckAdminAdvertisement.value = false;
  isCheckDish.value = false;
  isCheckShopCoupon.value = false;
  isCheckAddCoupon.value = false;
  isCheckComplianceShop.value = true;
  const data = {
    start: page.value,
    length: length.value,
  }
  api.post('/api/shop/searchComplianceShopByPage', data).then((response => {
    ComplianceShopList.value = response.result;
  }))
}
const checkAdvertisement = () => {
  current.value = "广告"
  console.log(current.value)
  isFirst.value = true;
  isTwo.value = false;
  isCheckShop.value = false;
  isCheckFinance.value = false;
  isCheckComplaint.value = false;
  isCheckCoupon.value = false;
  isCheckComplianceShop.value = false;
  isCheckDish.value = false;
  isCheckShopCoupon.value = false;
  isCheckAddCoupon.value = false;
  isCheckAdminAdvertisement.value = false;
  isCheckAdvertisement.value = true;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/advertisement/searchUnCheckAdvertisementByPage', data).then((response => {
    advertisementList.value = response.result;
  }))
}
const checkAdminAdvertisement = () => {
  current.value = "管理员审核广告"
  console.log(current.value)
  isFirst.value = true;
  isTwo.value = false;
  isCheckShop.value = false;
  isCheckFinance.value = false;
  isCheckComplaint.value = false;
  isCheckCoupon.value = false;
  isCheckComplianceShop.value = false;
  isCheckDish.value = false;
  isCheckShopCoupon.value = false;
  isCheckAddCoupon.value = false;
  isCheckAdvertisement.value = false;
  isCheckAdminAdvertisement.value = true;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/advertisement/searchUnCheckAdminAdvertisementByPage', data).then((response => {
    adminAdvertisementList.value = response.result;
  }))
}
const checkCoupon = () => {
  current.value = "优惠券"
  console.log(current.value, 111)
  isFirst.value = true;
  isTwo.value = false;
  isCheckShop.value = false;
  isCheckFinance.value = false;
  isCheckComplaint.value = false;
  isCheckAdvertisement.value = false;
  isCheckAdminAdvertisement.value = false;
  isCheckComplianceShop.value = false;
  isCheckDish.value = false;
  isCheckShopCoupon.value = false;
  isCheckAddCoupon.value = false;
  isCheckCoupon.value = true;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/coupon/searchUnCheckCouponByPage', data).then((response => {
    couponList.value = response.result;
  }))
}
const checkComplaint = () => {
  current.value = "投诉合规审核"
  console.log(current.value)
  isFirst.value = true;
  isTwo.value = false;
  isCheckShop.value = false;
  isCheckCoupon.value = false;
  isCheckAdvertisement.value = false;
  isCheckAdminAdvertisement.value = false;
  isCheckComplianceShop.value = false;
  isCheckDish.value = false;
  isCheckShopCoupon.value = false;
  isCheckAddCoupon.value = false;
  isCheckFinance.value = false;
  isCheckComplaint.value = true;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/complaint/searchUnCheckFirstComplaintByPage', data).then((response => {
    complaintList.value = response.result;
  }))
}
const checkFinance = () => {
  current.value = "投诉"
  console.log(current.value)
  isFirst.value = true;
  isTwo.value = false;
  isCheckShop.value = false;
  isCheckCoupon.value = false;
  isCheckAdvertisement.value = false;
  isCheckAdminAdvertisement.value = false;
  isCheckComplianceShop.value = false;
  isCheckDish.value = false;
  isCheckShopCoupon.value = false;
  isCheckAddCoupon.value = false;
  isCheckComplaint.value = false;
  isCheckFinance.value = true;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/complaint/searchUnCheckComplaintByPage', data).then((response => {
    financeList.value = response.result;
  }))
}
const checkShop = () => {
  current.value = "店铺"
  console.log(current.value)
  isFirst.value = true;
  isTwo.value = false;
  isCheckFinance.value = false;
  isCheckComplaint.value = false;
  isCheckCoupon.value = false;
  isCheckAdvertisement.value = false;
  isCheckAdminAdvertisement.value = false;
  isCheckComplianceShop.value = false;
  isCheckDish.value = false;
  isCheckShopCoupon.value = false;
  isCheckAddCoupon.value = false;
  isCheckShop.value = true;
  const data = {
    start: page.value,
    length: length.value
  }
  api.post('/api/shop/searchUnCheckShopByPage', data).then((response => {
    console.log(response.result)
    shopList.value = response.result;
  }))
}
const size = ref('')
const iconStyle = computed(() => {
  const marginMap = {
    large: '8px',
    default: '6px',
    small: '4px',
  }
  return {
    marginRight: marginMap[size.value] || marginMap.default,
  }
})
const blockMargin = computed(() => {
  const marginMap = {
    large: '32px',
    default: '28px',
    small: '24px',
  }
  return {
    marginTop: marginMap[size.value] || marginMap.default,
  }
})

const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
</script>

<style scoped>
.el-carousel__item h3 {
  color: #475669;
  opacity: 0.75;
  line-height: 300px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}

.el-descriptions {
  margin-top: 20px;
}

.cell-item {
  display: flex;
  align-items: center;
}

.margin-top {
  margin-top: 20px;
}

.layout-container-demo .el-header {
  position: relative;
  background-color: var(--el-color-primary-light-7);
  color: var(--el-text-color-primary);
}

.layout-container-demo .el-aside {
  color: var(--el-text-color-primary);
/*background: var(--el-color-primary-light-8); background: #eeeeee;*/
}

.layout-container-demo .el-menu {
  border-right: none;
}

.layout-container-demo .el-main {
  padding: 0;
}

.layout-container-demo .toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  right: 20px;
}
</style>
